home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / PlainText / MakeExtern < prev    next >
Text File  |  1990-10-01  |  611b  |  24 lines

  1. # MakeExtern makes a C include file declaring external globals.
  2. # It's input is the root declaration file for those globals.
  3. duplicate -y "{1}" "{2}"
  4. target "{2}"
  5. find •
  6. find /'Globals are declared here.'/
  7. clear ¡0:1
  8. # remove size from array declarations
  9. replace -c ∞ /∂[[a-zA-Z_0-9]+∂]/ ∂[∂]
  10. find •
  11. # remove trailing whitespace so that the next command can work
  12. replace -c ∞ /[ ∂t]+∂n/ ∂n
  13. # remove newlines after commas
  14. find •
  15. replace -c ∞ /,∂n/ ','
  16. find •
  17. # clear all curly bracket pairs
  18. replace -c ∞ /∂{≈∂}/ ''
  19. find •
  20. replace -c ∞ /=[¬,;]+/ ''
  21. find •
  22. replace -c ∞ /•([a-z_A-Z])®1/ 'extern ®1'
  23. close -y "{2}"
  24.